<template>
  <div class="home-top">
    <h3>人气推荐</h3>
    <div class="content">
      <van-card
        v-for="item in goodslist"
        :key="item.id"
        :tag="item.tag"
        :price="item.retail_price"
        :origin-price="item.origin_price"
        :desc="item.goods_brief"
        :title="item.name"
        :thumb="item.list_pic_url"
      ></van-card>
    </div>
  </div>
</template>

<script setup>
const goodslist = [
  {
    retail_price: "100",
    name: "商品1",
    list_pic_url: "/images/top1.jpg",
    goods_brief: "商品1的简介",
    origin_price: "eeeeee",
    tag: "热卖top1"
  },
  {
    retail_price: "100",
    name: "商品2",
    list_pic_url: "/images/top2.jpg",
    goods_brief: "商品2的简介",
    origin_price: "eeeeee",
    tag: "热卖top2"
  }
];
</script>

<style lang="less" scoped>
.home-top {
  h3 {
    font-size: 16px;
    text-align: center;
    margin-top: 1.6rem;
  }
  .content {
    --van-tag-primary-color: #ff8000;
    --van-card-font-size: 16px;
    --van-card-background: #f9f9f9;
    background: var(--van-card-background);
    :deep(.van-card) {
      margin-top: 0;
      .van-card__title {
        padding: 10px 0 5px;
      }
      .van-card__price-currency {
        font-size: var(--van-card-font-size);
      }
    }
    &::after {
      content: "";
      display: block;
      height: 3rem;
    }
  }
}
</style>
